theme(legend.position = "none")
plt.16.p.ni
plt.16.p.ni <- yg16 %>%
filter(pol.class == "Rep Near Ideologue" | pol.class == "Dem Near Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Near Ideologues", size = 3, color = "red") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Near Ideologues", size = 3, color = "blue") +
scale_fill_grey() +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.ni
plt.16.p.ni <- yg16 %>%
filter(pol.class == "Rep Near Ideologue" | pol.class == "Dem Near Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Near Ideologues", size = 3, color = "red") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Near Ideologues", size = 3, color = "blue") +
scale_fill_grey() +
scale_color_manual(values = c("blue",
"red")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
scale_color_manual(values = c("black",
"forestgreen",
"darkorchid4")) +
plt.16.p.ni
plt.16.p.ni <- yg16 %>%
filter(pol.class == "Rep Near Ideologue" | pol.class == "Dem Near Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Near Ideologues", size = 3, color = "red") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Near Ideologues", size = 3, color = "blue") +
scale_fill_grey() +
scale_color_manual(values = c("blue",
"red")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.ni
plt.16.p.i <- yg16 %>%
filter(pol.class == "Rep Ideologue" | pol.class == "Dem Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Ideologues", size = 3, color = "firebrickred1") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Ideologues", size = 3, color = "dodgerblue4") +
scale_fill_grey() +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.i
plt.16.p.i <- yg16 %>%
filter(pol.class == "Rep Ideologue" | pol.class == "Dem Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Ideologues", size = 3, color = "firebrickred1") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Ideologues", size = 3, color = "dodgerblue4") +
scale_fill_grey() +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.i <- yg16 %>%
filter(pol.class == "Rep Ideologue" | pol.class == "Dem Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Ideologues", size = 3, color = "firebrickred") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Ideologues", size = 3, color = "dodgerblue4") +
scale_fill_grey() +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.i
plt.16.p.i <- yg16 %>%
filter(pol.class == "Rep Ideologue" | pol.class == "Dem Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Ideologues", size = 3, color = "firebrick1") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Ideologues", size = 3, color = "dodgerblue4") +
scale_fill_grey() +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.i
plt.16.p.i <- yg16 %>%
filter(pol.class == "Rep Ideologue" | pol.class == "Dem Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 1.05,
label = "Republican Ideologues", size = 3, color = "red") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Ideologues", size = 3, color = "blue") +
scale_fill_grey() +
scale_color_manual(values = c("blue",
"red")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.i
plt.16.p.ni <- yg16 %>%
filter(pol.class == "Rep Near Ideologue" | pol.class == "Dem Near Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weight/sum(weight))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Near Ideologues", size = 3, color = "firebrick1") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Near Ideologues", size = 3, color = "dodgerblue4") +
scale_fill_grey() +
scale_color_manual(values = c("dodgerblue4",
"firebrick1")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.16.p.ni
plt.16.p.i
plt.16.p.ni
plt.16.p.m
# Compute cross-tabs of respondent types.
prop.table(table(yg16$pol.class))
# Compute cross-tabs of respondent types.
prop.table(table(yg15$pol.class))
# Compute cross-tabs of respondent types.
prop.table(table(yg15$pol.class))
yg15$pol.class <- fct_relevel(yg15$pol.class, "No issue content")
# Mutate data.
yg15 <- yg15 %>% # 2015
mutate(pol.class = case_when(pid3 == "Republican" & ideo5 == "Very conservative" ~ "Rep Ideologue",
pid3 == "Democrat" & ideo5 == "Very liberal" ~ "Dem Ideologue",
pid3 == "Republican" & ideo5 == "Conservative" ~ "Rep Near Ideologue",
pid3 == "Democrat" & ideo5 == "Liberal" ~ "Dem Near Ideologue",
(ideo5 == "Moderate" | ideo5 == "Don't know") & (pid3 == "Democrat" | pid3 == "Republican") ~ "Moderate Partisan",
pid3 == "Independent" & ideo5 == "Moderate" ~ "True Moderate",
TRUE ~ "No issue content")) %>%
mutate(pol.class = factor(pol.class))
yg15$pol.class <- fct_relevel(yg15$pol.class, "No issue content")
# Compute cross-tabs of respondent types.
prop.table(table(yg15$pol.class))
# Compute cross-tabs of respondent types.
sort(prop.table(table(yg15$pol.class)))
sort(prop.table(table(yg16$pol.class)))
# Compute cross-tabs of respondent types.
(pc.2015 <- (sort(prop.table(table(yg15$pol.class))) * 100) %>% round(digits = 3))
(pc.2016 <- (sort(prop.table(table(yg16$pol.class))) * 100) %>% round(digits = 3))
# Generate plots.
plt.15.p.i <- yg15 %>%
filter(pol.class == "Rep Ideologue" | pol.class == "Dem Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weights/sum(weights))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 1.05,
label = "Republican Ideologues", size = 3, color = "red") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Ideologues", size = 3, color = "blue") +
scale_fill_grey() +
scale_color_manual(values = c("blue",
"red")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.15.p.i
# Generate plots.
plt.15.p.i <- yg15 %>%
filter(pol.class == "Rep Ideologue" | pol.class == "Dem Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weights/sum(weights))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.75,
label = "Republican Ideologues", size = 3, color = "red") +
annotate(geom = "text", x = -0.75, y = 1.5,
label = "Democrat Ideologues", size = 3, color = "blue") +
scale_fill_grey() +
scale_color_manual(values = c("blue",
"red")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.15.p.i
plt.15.p.ni <- yg15 %>%
filter(pol.class == "Rep Near Ideologue" | pol.class == "Dem Near Ideologue") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weights/sum(weights))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.6, y = 0.7,
label = "Republican Near Ideologues", size = 3, color = "firebrick1") +
annotate(geom = "text", x = -0.65, y = 1.5,
label = "Democrat Near Ideologues", size = 3, color = "dodgerblue4") +
scale_fill_grey() +
scale_color_manual(values = c("dodgerblue4",
"firebrick1")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.15.p.ni
plt.15.p.m <- yg15 %>%
filter(pol.class == "Moderate Partisan" | pol.class == "True Moderate" | pol.class == "No issue content") %>%
ggplot(aes(diet_mean_newspol, fill = pol.class, color = pol.class,
weight = weights/sum(weights))) +
geom_density(alpha = 0.5) +
annotate(geom = "text", x = 0.1, y = 1.90,
label = "Moderate Partisans", size = 3, color = "forestgreen") +
annotate(geom = "text", x = -0.5, y = 1.5,
label = "True Moderates", size = 3, color = "darkorchid4") +
annotate(geom = "text", x = 0.75, y = 0.5,
label = "No Issue Content", size = 3, color = "black") +
scale_fill_grey() +
scale_color_manual(values = c("black",
"forestgreen",
"darkorchid4")) +
theme_classic() +
ggtitle("News/politics only (2016; weighted)") +
labs(x = "Average media diet slant",
y = "Desity",
color = "Ideological Class",
fill = "Ideological Class") +
lims(x = c(-1, 1)) +
theme(legend.position = "none")
plt.15.p.m
# Arrange and save the ideological class plots.
ggarrange(plt.15.p.i, plt.16.p.i,
plt.15.p.ni, plt.16.p.ni,
plt.15.p.m, plt.16.p.m)
# Arrange and save the ideological class plots.
plt.ideotypes <- ggarrange(plt.15.p.i, plt.16.p.i,
plt.15.p.ni, plt.16.p.ni,
plt.15.p.m, plt.16.p.m)
plt.ideotypes
# Arrange and save the ideological class plots.
plt.ideotypes <- ggarrange(plt.15.p.i, plt.16.p.i,
plt.15.p.ni, plt.16.p.ni,
plt.15.p.m, plt.16.p.m,
nrow = 3,
ncol = 2)
plt.ideotypes
overlap.1 <- overlap(x = yg15 %>% # Overlap between Democrats and Republicans.
filter(pol.class == "Dem Ideologue") %>%
pull(diet_mean_newspol),
y = yg15 %>%
filter(pol.class == "Rep Ideologue") %>%
pull(diet_mean_newspol))
overlap.2 <- overlap(x = yg15 %>% # Overlap between Democrats and Republicans.
filter(pol.class == "Dem Near Ideologue") %>%
pull(diet_mean_newspol),
y = yg15 %>%
filter(pol.class == "Rep Near Ideologue") %>%
pull(diet_mean_newspol))
overlap.3 <- overlap(x = yg16 %>% # Overlap between Democrats and Republicans.
filter(pol.class == "Dem Ideologue") %>%
pull(diet_mean_newspol),
y = yg16 %>%
filter(pol.class == "Rep Ideologue") %>%
pull(diet_mean_newspol))
overlap.4 <- overlap(x = yg16 %>% # Overlap between Democrats and Republicans.
filter(pol.class == "Dem Near Ideologue") %>%
pull(diet_mean_newspol),
y = yg16 %>%
filter(pol.class == "Rep Near Ideologue") %>%
pull(diet_mean_newspol))
overlap.1
overlap.3
overlap.2
overlap.3
overlap.4
gdf$ideo5
# Compute MAUDs and SMAUDs for various model types.
maud.tgi.1 <- maud.gen(starprep(greg)[[1]],
summary(greg)$coefficients[,2])
maud.tgi.2 <- maud.gen(starprep(greg2)[[1]],
summary(greg2)$coefficients[,2])
maud.tgi.3 <- maud.gen(starprep(greg3)[[1]],
summary(greg3)$coefficients[,2])
maud.tgi.4 <- maud.gen(starprep(greg4)[[1]],
summary(greg4)$coefficients[,2])
maud.tgi.5 <- maud.gen(starprep(greg5)[[1]],
summary(greg5)$coefficients[,2])
maud.tgi.4 <- maud.gen(starprep(greg4)[[1]],
summary(greg4)$coefficients[,2])
maud.tgi.5 <- maud.gen(starprep(greg5)[[1]],
summary(greg5)$coefficients[,2])
greg4 <- lm(mean_align ~ Age + Race + Female + Income_Numeric + Educ + Party +
Ideology + newsint,
data = gdf,
weights = gdf$weight)
greg5 <- lm(mean_align ~ Age + Race + Female + Income_Numeric +
Educ + Party + Ideology + newsint + newsintxpid,
data = gdf,
weights = gdf$weight)
maud.tgi.3 <- maud.gen(starprep(greg3)[[1]],
summary(greg3)$coefficients[,2])
maud.tgi.4 <- maud.gen(starprep(greg4)[[1]],
summary(greg4)$coefficients[,2])
maud.tgi.5 <- maud.gen(starprep(greg5)[[1]],
summary(greg5)$coefficients[,2])
maud.tgi.5 <- maud.gen(starprep(greg5)[[1]],
summary(greg5)$coefficients[,2])
maud.tgi.5 <- maud.gen(starprep(glm5)[[1]],
summary(glm5)$coefficients[,2])
maud.tgi.5 <- maud.gen(starprep(gglm5)[[1]],
summary(gglm5)$coefficients[,2])
greg5.2 <- lm(mean_align ~ Age + Race + Female + Income_Numeric +
Educ + Party + Ideology + Party * newsint,
data = gdf,
weights = gdf$weight)
maud.tgi.5 <- maud.gen(starprep(greg5.2)[[1]],
summary(greg5.2)$coefficients[,2])
smaud.tgi.1 <- maud.gen(starprep(greg)[[1]],
summary(greg)$coefficients[,2], 1)
# Table 6: MAUD/SMAUD/GIM Tests on New Data.
# Compute MAUDs and SMAUDs for various model types.
maud.tgi.1 <- maud.gen(starprep(greg)[[1]],
summary(greg)$coefficients[,2])
maud.tgi.2 <- maud.gen(starprep(greg2)[[1]],
summary(greg2)$coefficients[,2])
maud.tgi.3 <- maud.gen(starprep(greg3)[[1]],
summary(greg3)$coefficients[,2])
maud.tgi.4 <- maud.gen(starprep(greg4)[[1]],
summary(greg4)$coefficients[,2])
maud.tgi.5 <- maud.gen(starprep(greg5.2)[[1]],
summary(greg5.2)$coefficients[,2])
smaud.tgi.1 <- maud.gen(starprep(greg)[[1]],
summary(greg)$coefficients[,2], 1)
smaud.tgi.2 <- maud.gen(starprep(greg2)[[1]],
summary(greg2)$coefficients[,2], 1)
smaud.tgi.3 <- maud.gen(starprep(greg3)[[1]],
summary(greg3)$coefficients[,2], 1)
smaud.tgi.4 <- maud.gen(starprep(greg4)[[1]],
summary(greg4)$coefficients[,2], 1)
smaud.tgi.5 <- maud.gen(starprep(greg5.2)[[1]],
summary(greg5.2)$coefficients[,2], 1)
mauds.tgi <- c(maud.tgi.1, maud.tgi.2, maud.tgi.3,
maud.tgi.4, maud.tgi.5)
smauds.tgi <- c(smaud.tgi.1, smaud.tgi.2, smaud.tgi.3,
smaud.tgi.4, smaud.tgi.5)
avg.guess <- c(mean(mauds),
mean(smauds))
avg.tgi <- c(mean(mauds.tgi),
mean(smauds.tgi))
# MAUD/SMAUD subfigures.
unc.dat <- data.frame(maud = mauds,
smaud = smauds,
rot = c(GIM.tgi.1$`Rule of Thumb`,
GIM.tgi.2$`Rule of Thumb`,
GIM.tgi.3$`Rule of Thumb`,
GIM.tgi.4$`Rule of Thumb`,
GIM.tgi.5$`Rule of Thumb`),
tstat = c(GIM.tgi.1$`GIM test statistic`,
GIM.tgi.2$`GIM test statistic`,
GIM.tgi.3$`GIM test statistic`,
GIM.tgi.4$`GIM test statistic`,
GIM.tgi.5$`GIM test statistic`),
model = c("PID", "Ideo", "Combined", "Interest", "PID x Interest"))
# MAUD/SMAUD subfigures.
unc.dat <- data.frame(maud = mauds.tgi,
smaud = smauds.tgi,
rot = c(GIM.tgi.1$`Rule of Thumb`,
GIM.tgi.2$`Rule of Thumb`,
GIM.tgi.3$`Rule of Thumb`,
GIM.tgi.4$`Rule of Thumb`,
GIM.tgi.5$`Rule of Thumb`),
tstat = c(GIM.tgi.1$`GIM test statistic`,
GIM.tgi.2$`GIM test statistic`,
GIM.tgi.3$`GIM test statistic`,
GIM.tgi.4$`GIM test statistic`,
GIM.tgi.5$`GIM test statistic`),
model = c("PID", "Ideo", "Combined", "Interest", "PID x Interest"))
m.plt <- unc.dat %>%
ggplot(aes(x = maud, y = model, label = model)) +
geom_point(size = 3, shape = 24, fill = "blue", color = "darkred") +
geom_vline(xintercept = 0, lty = "dotted") +
labs(x = "MAUD",
y = "Model",
title = "MAUDs by Model Specification") +
theme_pubr()
m.plt
sm.plt <- unc.dat %>%
ggplot(aes(x = smaud, y = model, label = model)) +
geom_point(size = 3, shape = 23, fill = "blue", color = "darkred") +
geom_vline(xintercept = 0, lty = "dotted") +
labs(x = "SMAUD",
y = "Model",
title = "SMAUDs by Model Specification") +
theme_pubr()
sm.plt
rot.plt
# GIM statistics subfigures.
rot.plt <- unc.dat %>%
ggplot(aes(x = rot, y = model, label = model)) +
geom_point(size = 3, shape = 22, fill = "blue", color = "darkred") +
geom_vline(xintercept = 0, lty = "dotted") +
labs(x = "(GIM) Rule of Thumb",
y = "Model",
title = "(GIM) Rules of Thumb by Model Specification") +
theme_pubr()
rot.plt
tstat.plt <- unc.dat %>%
ggplot(aes(x = rot, y = model, label = model)) +
geom_point(size = 3, shape = 22, fill = "blue", color = "darkred") +
geom_vline(xintercept = 0, lty = "dotted") +
labs(x = "(GIM) Rule of Thumb",
y = "Model",
title = "(GIM) Rules of Thumb by Model Specification") +
theme_pubr()
tstat.plt
sm.plt <- unc.dat %>%
ggplot(aes(x = smaud, y = model, label = model)) +
geom_point(size = 3, shape = 23, fill = "blue", color = "darkred") +
geom_vline(xintercept = 0, lty = "dotted") +
labs(x = "SMAUD",
y = "Model",
title = "SMAUDs by Model Specification") +
theme_pubr()
sm.plt
m.plt <- unc.dat %>%
ggplot(aes(x = maud, y = model, label = model)) +
geom_point(size = 3, shape = 24, fill = "blue", color = "darkred") +
geom_vline(xintercept = 0, lty = "dotted") +
labs(x = "MAUD",
y = "Model",
title = "MAUDs by Model Specification") +
theme_pubr()
sm.plt <- unc.dat %>%
ggplot(aes(x = smaud, y = model, label = model)) +
geom_point(size = 3, shape = 23, fill = "blue", color = "darkred") +
geom_vline(xintercept = 0, lty = "dotted") +
labs(x = "SMAUD",
y = "Model",
title = "SMAUDs by Model Specification") +
theme_pubr()
m.plt
